package com.hsmpay.mobile.service.trans;

import com.hsmpay.common.service.BaseService;
import com.hsmpay.mobile.pojo.trans.TransOrder;

import java.io.Serializable;
import java.sql.SQLException;

/**
 * 交易订单  服务接口 transOrderService
 * 对应dao TransOrderDao
 *
 * @param <Entity>
 * @param <Query>
 * @author 颜铃璋
 *         创建时间：2013-1-24
 */
public interface TransOrderService<Entity extends Serializable, Query extends Object> extends BaseService<Entity, Query> {
    /**
     * 根据订单ID修改状态
     *
     * @param orderNum
     * @param status
     * @param clearing
     * @return
     */
    public int updateStatusClearing(String orderNum, Integer status, Integer clearing) throws Exception;

    /**
     * 查询 单卡当天所有交易总额
     *
     * @param accountNumber
     * @return
     * @throws Exception
     */
    public Double getOneCardTodayTransMoneySum(String accountNumber) throws Exception;

    /**
     * 查询 用户信用卡 当天所有交易总额
     *
     * @param userId
     * @return
     * @throws Exception
     */
    public Double getCreditCardTodayTransMoneySum(Long userId) throws Exception;

    /**
     * 查询 用户 信用卡交易 大于5000的比数
     *
     * @param userId
     * @return
     * @throws Exception
     */
    public int getCreditCardTodayTransMoneySum5000Cnt(Long userId) throws Exception;

    /**
     * 修改签名
     *
     * @param order
     * @return
     * @throws SQLException
     */
    public int updateSignaturePathByNum(TransOrder order) throws Exception;

    /**
     * 修改提现订单号
     *
     * @param orderNum
     * @param cashOrderNum
     * @return
     * @throws SQLException
     */
    public int updateCashOrderByNum(String orderNum, String cashOrderNum) throws Exception;

    /**
     * 根据登录名 + 商户订单号 查询订单
     *
     * @param loginName
     * @param MerchantOrderId
     * @return
     * @throws Exception
     */
    public TransOrder searchOrderByMerchantOrderId(String loginName, String MerchantOrderId) throws Exception;

    /**
     * 订单编号 查询订单
     *
     * @param orderNum
     * @return
     * @throws Exception
     */
    public TransOrder searchOrderByOrderNum(String orderNum) throws Exception;

    /**
     * 修改机构号
     * @param transOrder
     * @return
     * @throws Exception
     */
    public int updateOrganizationId(TransOrder transOrder) throws Exception;

    /**
     * 根据userId + 商户订单号 查询订单
     *
     * @param userId
     * @param MerchantOrderId
     * @return
     * @throws Exception
     */
    public TransOrder searchOrderByMerAndUserId(long userId, String MerchantOrderId) throws Exception;

}
